﻿﻿(function($) {
	$.fn.validationEngineLanguage = function() {
	};
	$.validationEngineLanguage = {
		newLang : function() {
			$.validationEngineLanguage.allRules = {
				"required" : { // Add your regex rules here, you can take
								// telephone as an example
					"regex" : "none",
					"alertText" : "* 必填项",
					"alertTextCheckboxMultiple" : "* 请选择一项",
					"alertTextCheckboxe" : "* 该选择框必须"
				},
				
				"lengthUtf" : {
					"regex" : "none",
					"alertText" : "* 输入需在 ",
					"alertText2" : " 至 ",
					"alertText3" : " 个字符 ",
					"alertText4" : " 或",
					"alertText5" : " 至 ",
					"alertText6" : " 个汉字 "
				
				},
				"length" : {
					"regex" : "none",
					"alertText" : "* 输入需在 ",
					"alertText2" : " 至",
					"alertText3" : " 个字符 "
				},
				"charLength" : {
					"regex" : "none",
					"alertText" : "* 输入需在 ",
					"alertText2" : " 至 ",
					"alertText3" : " 个中英文字符 "
				},
				"maxCheckbox" : {
					"regex" : "none",
					"alertText" : "* Checks allowed Exceeded"
				},
				"minCheckbox" : {
					"regex" : "none",
					"alertText" : "* 请选择",
					"alertText2" : " 项"
				},
				"confirm" : {
					"regex" : "none",
					"alertText" : "* 输入不满足格式"
				},
				"telephone" : {
					"regex" : "/^[+]{0,1}[0-9\-\(\)\ ]+$/",
					"alertText" : "* 无效的电话号码"
				},
				"telephoneLocale" : {
					"regex" : "/^[0-9]{3,4}-[0-9\-\(\)\ ]+$/",
					"alertText" : "* 无效的电话号码"
				},
				"email" :{
					"regex" : "/^[a-zA-Z0-9_\.\-]+\@([a-zA-Z0-9\-]+[.])+\.[a-zA-Z0-9]{1,3}$/",
					"alertText" : "* 无效的E-mail地址"
				},
				"date" : {
					//"regex" : "/^[123][0-9]{3}\-\((0?[1-9])|(1[012]))\-\((0?[1-9])|([1-2]\\d)|(3[01]))$/",
					"regex" : "/(^\\d{4}-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01])$)|((0[469]|11)-(0[1-9]|[12][0-9]|30)$)|(02-(0[1-9]|[1][0-9]|2[0-8])$)))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29$)/",
					"alertText" : "* 无效的日期（格式如YYYY-MM-DD）"
				},
				"dateHHMM" : {
					"regex" : "/^[0-1]{1}[0-9]{1}\:\[0-5]{1}[0-9]{1}$/",
					"alertText" : "* 无效的时分（格式如HH:MM）"
				},
				"onlyNumber" : {
					"regex" : "/(^0$|^[1-9][0-9]*$)/",
					"alertText" : "* 只允许数字"
				},
				"time" : {
					"regex" : "/^(0[0-9]|1[0-9]|2[0-3]):(0[0-9]|[1-5][0-9])$/",
					"alertText" : "* 时间格式不正确（格式如HH:MM）"
				},
				"onlyInteger":{
					"regex" : "/^[1-9][0-9]*$/",
					"alertText" : "* 只允许正整数"
				},
				"noSpecialCaracters" : {
					"regex" : "/^[0-9a-zA-Z\u4e00-\u9fa5_]+$/",
					"alertText" : "* 不能包含特殊字符"
				},
				"noSpecialCaractersMemo" : {
					"regex" : "/^[0-9a-zA-Z\u4e00-\u9fa5_\.,;\!?@:：，。；！？、 \r\n\t]*$/",
					"alertText" : "* 不能包含特殊字符"
				},
				"ajaxUser" : {
					"file" : "validateUser.php",
					"extraData" : "name=eric",
					"alertTextOk" : "* This user is available",
					"alertTextLoad" : "* Loading, please wait",
					"alertText" : "* This user is already taken"
				},
				"ajaxName" : {
					"file" : "validateUser.php",
					"alertText" : "* This name is already taken",
					"alertTextOk" : "* This name is available",
					"alertTextLoad" : "* Loading, please wait"
				},
				"onlyLetter" : {
					"regex" : "/^[a-zA-Z\ \']+$/",
					"alertText" : "* 只允许英文字母"
				},
				"validate2fields" : {
					"nname" : "validate2fields",
					"alertText" : "* You must have a firstname and a lastname"
				},
				"moneyNumber" : {
					"regex" : "/^[0-9\ ]+$/",
					"alertText" : "* 请输入有效货币"
				},
				"currency" : {
					"regex" : "/^([+-])?(\\d+(,\\d\\d\\d)*(\\.\\d{1,2})?|\\d+(\\.\\d{1,2})?)$/",
					"alertText" : "* 请输入有效货币（可以是千分位格式，最多两位小数）"
				},
				"moneyFormatNumber" : {
					"regex" : "/^([+-])?(\\d+(,\\d\\d\\d)*|\\d+?)$/",
					"alertText" : "* 请输入有效货币"
				},
				"decimal" : {
					"regex" : "/^\\d{0,8}(\\.\\d{1,2})?$/",
					"alertText" : "* 请输入有效数字（最多两位小数）"
				},
				"mobilePhone" : {
					"regex" : "/^1\\d{10}$/",
					"alertText" : "* 请输入正确的手机号。"
				},	
				
				"password" : {
					"regex" : "/^1\\d{10}$/",
					"alertText" : "* 请输入至少6位密码。"
				},
				
				"msrp" :{
					"regex" : "/^((0(\\.\\d{1,4})?)|([1-9]\\d{0,11}(\\.\\d{1,4})?))?$/",
					"alertText" : "* 请输入有效不超过16位的数字（最多四位小数）"		
				},
				"Decimal_16_4" :{
					"regex" : "/^\\d{0,12}(\\.\\d{1,4})?$/",
					"alertText" : "* 请输入有效金额"		
				},
				"dateOrNull" : {
					//"regex" : "/^([123][0-9]{3}\-((0?[1-9])|(1[012]))\-((0?[1-9])|([1-2]\\d)|(3[01])))?$/",
					"regex" : "/^((^\\d{4}-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01])$)|((0[469]|11)-(0[1-9]|[12][0-9]|30)$)|(02-(0[1-9]|[1][0-9]|2[0-8])$)))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29$))?$/",
					"alertText" : "无效的日期(YYYY-MM-DD)"
				},
				"notZero":{
					"regex" : "/^[1-9][0-9]*$/",
					"alertText" : "请选择一项"
				},
				"mobilePhoneOrNull" : {
					"regex" : "/^(1\\d{10})?$/",
					"alertText" : "* 请输入正确的手机号。"
				},
				"moneyAndNotZero" : {
					"regex" : "/^((([1-9]{1}\\d{0,9}))|($))((\\.(\\d){2}))?$/",
					"alertText" : "* 请输入有效数字（最多两位小数）"
				},
				"postCode":{
					"regex":"/^(\\d{6})?$/",
					"alertText" : "请输入六位数的邮编"
				},
				"year":{
					"regex":"/^([123]\\d{3})?$/",
					"alertText" : "请输入正确的年份"
				},
				"month":{
					"regex":"/^(([1-9])|(1[0-2]))?$/",
					"alertText" : "请输入正确的月份"
				},
				"idCard" : {
					"regex" : "/^(\\d{15}|(\\d{17}[\\dXx]))*$/",
					"alertText" : "无效的身份证号"
				},
				"LT100":{
					"regex":"/^([\\d]|([1-9][\\d])|100)$/",
					"alertText" : "数字必须小于100"
				},
				"NullOrNumber" : {
					"regex" : "/^([0-9]\\d{0,10})?$/",
					"alertText" : "* 只允许数字"
				},
//				"dayOfHours" : {
//					"regex" : "/^(([0-1][0-9])|2[0-3]):[0-5][0-9]:[0-5][0-9]$/",
//					"alertText" : "时间格式不正确（00:00:00）"
//				},
				"dayOfHours" : {
					"regex" : "/^(([0-1][0-9])|2[0-3]):[0-5][0-9]$/",
					"alertText" : "时间格式不正确（00:00）"
				},
				"NullOrMobile" : {
					"regex" : "/^(1\\d{10})?$/",
					"alertText" : "* 请输入正确的手机号。"
				},
				"NullOrmoneyNumber" : {
					"regex" : "/^([0-9\ ]+)?$/",
					"alertText" : "* 请输入有效货币"
				},
				"LT99": {
					"regex":"/^([1-9]|([1-9][\\d]))$/",
					"alertText" : "只允许1-99的数字。"
				},
				"NullOrMobilelike" : {
					"regex" : "/^(1\\d{3,10})?$/",
					"alertText" : "*  请输入手机号前四位有效数字。 "
				}
			};

		}
	}
})(jQuery);

$(document).ready(function() {
	$.validationEngineLanguage.newLang();
});